package com.sumainfor.pc.market.controller.rentadviser;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.RdBankService;
import com.sumainfor.pc.market.service.RdHousingDepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @Describe 房源描述模板
 */
@RestController
@RequestMapping("/rentadviser/RdHousingDepController")
public class RdHousingDepController implements Serializable {
    @Autowired
    private RdHousingDepService rdHousingDepService;
    /**
     * 查询房源描述模板下拉框
     */
    @GetMapping("/getHousingDepList")
    public JsonResult getHousingDepList(){
        JsonResult result=new JsonResult();
        List<Map<String,Object>> list=rdHousingDepService.getHousingDepList();
        if (list!=null){
            result.put(list);
        }else{
            result.putFailed("服务器繁忙");
        }
        return result;
    }
    /**
     * 创建房源描述模板
     */
    @PostMapping("/addHousingDep")
    public JsonResult addHousingDep(@RequestBody Map<String,Object>params){
        JsonResult result=new JsonResult();
        int resultsjk=rdHousingDepService.addHousingDep(params);
        if (resultsjk>0){
            result.putSuccess("创建成功");
        }else{
            result.putFailed("服务器繁忙");
        }
        return  result;
    }
}
